-- GENERATED SPELL FOR [Infinite Timereaver] --


function spell0_21698(pUnit, Event) --@Hasten,Self--
pUnit:FullCastSpellOnTarget(31458,pUnit)
pUnit:RegisterEvent('Sorts_21698', 10276, 1)
end

function spell1_21698(pUnit, Event) --@Mortal Wound,Heal--
pUnit:FullCastSpellOnTarget(31464,pUnit)
pUnit:RegisterEvent('Sorts_21698', 15252, 1)
end

function spell2_21698(pUnit, Event) --@Spell Reflection,Self--
pUnit:FullCastSpellOnTarget(38592,pUnit)
pUnit:RegisterEvent('Sorts_21698', 6314, 1)
end

function spell3_21698(pUnit, Event) --@Wing Buffet,Self--
pUnit:FullCastSpellOnTarget(38593,pUnit)
pUnit:RegisterEvent('Sorts_21698', 602, 1)
end

function Sorts_21698(pUnit, Event)
local choix_sorts_21698 = math.random(0, 3)
if choix_sorts_21698 == 0 then
pUnit:RegisterEvent('spell0_21698', 1, 1)
end
if choix_sorts_21698 == 1 then
pUnit:RegisterEvent('spell1_21698', 1, 1)
end
if choix_sorts_21698 == 2 then
pUnit:RegisterEvent('spell2_21698', 1, 1)
end
if choix_sorts_21698 == 3 then
pUnit:RegisterEvent('spell3_21698', 1, 1)
end
end

function mob21698_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21698', math.random(1500, 3000), 1)
end

function mob21698_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21698_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21698_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21698, 1, 'mob21698_Action')
RegisterUnitEvent(21698, 2, 'mob21698_Leave')
RegisterUnitEvent(21698, 3, 'mob21698_Kill')
RegisterUnitEvent(21698, 4, 'mob21698_Die')
